package com.example.controller;

import com.example.pojo.Area;
import com.example.service.AreaService;
import com.example.utils.Result;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/area")
@Api(tags = "区域管理")
public class AreaController {

    @Autowired
    private AreaService areaService;

    @GetMapping("/selectProvince")
    public Result selectProvince(@RequestParam( name = "cid",defaultValue = "") Integer cid){
        List<Area> list = areaService.selectProvince(cid);
        return new Result<>("200","查询成功",list);
    }
}
